﻿namespace xrwang.DDNS
{
    /// <summary>
    /// DDNS信息
    /// </summary>
    public class DDNSInfo
    {
        /// <summary>
        /// 云服务供应商
        /// </summary>
        public string CSP { get; set; }
        /// <summary>
        /// 密匙id
        /// </summary>
        public string AccessKeyID { get; set; }
        /// <summary>
        /// 密匙
        /// </summary>
        public string AccessKeySecret { get; set; }
        /// <summary>
        /// 项目id
        /// </summary>
        /// <remarks>华为云需要项目id，阿里云和腾讯云不需要该参数</remarks>
        public string ProjectId { get; set; }
        /// <summary>
        /// 域名记录
        /// </summary>
        public List<DomainRecordInfo> DomainRecords { get; set; }

        /// <summary>
        /// 返回字符串
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("云服务供应商：{1:g}{0}密匙id：{2}{0}密匙：{3}{0}域名记录：{4}",
                Environment.NewLine, CSP, AccessKeyID, AccessKeySecret,
                DomainRecords != null ? string.Join(Environment.NewLine, DomainRecords) : "");
        }
    }
}